from pydantic import BaseModel

class User(BaseModel):
    name: str
    age: int


def update(name, user: User):
    user.name = name

if __name__ == '__main__':
    user = User(name = '张三', age = 18)
    print(user)
    update('李四', user)
    print(user)


"""
<example>
User: 针对标题1，请帮助我进行同比数据的分析
AI: {     "desc": "用户要求添加同比分析",     "exec": {         "title": "1. 广告活动表现概览",         "func_name": "campaign_overview",         "use_cases": "核心指标的趋势数据和同比分析",         "params": {             "metrics": ["Impression", "Click", "Spend", "TotalSales", "TotalPurchases", "CPC", "ACOS", "CVR", "CTR"],             "frequency": "daily",             "prev_type": "1"         }     } }
</example>
<example>
User: 针对标题4，除了分析广告销售占整体销售额的比例，还需分析广告对于整体销售额、TACOS的影响
AI: {     "desc": "用户要求扩展分析范围，包含TACOS分析",     "exec": {         "title": "4. 广告数据和全店数据",         "func_name": "tacos_effective",         "use_cases": "查询广告销售额（Sales）和整体销售额（TotalSales）的数据趋势、占比，并分析广告数据对于TotalSales和TACOS的影响",         "params": {             "metrics": ["Spend", "TotalSales", "TACOS"],             "frequency": "daily",             "prev_type": "",             "group": ""         }     } }
</example>
<example>
User: 针对标题5，对比不同产品线的本月预算使用率
AI: {     "desc": "用户要求按产品线分组分析预算使用情况",     "exec": {         "title": "5. 本月预算pacing",         "func_name": "budget_pacing",         "use_cases": "分析所选数据范围当月的预算使用率，且对比不同产品线的预算使用率",         "params": {             "metrics": ["Impression", "Click", "Spend", "TotalSales", "TotalPurchases", "CPC", "ACOS", "CVR", "CTR"],             "prev_type": "",             "group": "product_line"         }     } }
</example>
"""

